package org.footballmanager.pandafootball.system.form.impl;

import lombok.Getter;
import lombok.Setter;
import org.footballmanager.pandafootball.system.domain.FootSociatyBfinfo;
import org.footballmanager.pandafootball.system.domain.enums.BFLX;
import org.footballmanager.pandafootball.system.domain.enums.BFZT;
import org.footballmanager.pandafootball.system.form.SearchForm;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;

@Setter
@Getter
public class FootSociatyBfinfoSearchForm extends SearchForm implements Serializable {
    private static final long serialVersionUID = 8090668615941861140L;
    protected BFZT bfzt;
    protected Long bfqd;
    protected String zdName;

    public Example buildSearchCommond() {
        Example example = new Example(FootSociatyBfinfo.class);
        Example.Criteria criteria = example.createCriteria();
        if(bfzt != null){
            criteria.andEqualTo("bfzt", bfzt);
        }
        if(bfqd != null){
            criteria.andEqualTo("zd1", bfqd);
        }
        criteria.andEqualTo("delFlag", 0);
        example.orderBy("bfTime desc");
        return example;
    }

}
